package Iterator;

public class Client {
    public static void main(String[] args) {
        Television tv1 = new SkyworthTelevision();
        display(tv1);
        Television tv2 = new TCLTelevision();
        display(tv2);
    }

    public static void display(Television tv)
    {
        TVIterator it = tv.createIterator();
        System.out.println("电视机频道");
        while(!it.isLast())
        {
            System.out.println(it.currentChannel());
            it.next();
        }
    }

}
